﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OrderList1.aspx.cs" Inherits="WeChat.MenuReservation.OrderList1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" />
    <title></title>
    <script src="../Script/rem.js"></script>
    <script src="../Script/jquery.min.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="../css/base.css" />
    <link rel="stylesheet" type="text/css" href="../css/page.css" />
    <link rel="stylesheet" type="text/css" href="../css/all.css" />
    <link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
    <link rel="stylesheet" type="text/css" href="../css/loaders.min.css" />
    <link rel="stylesheet" type="text/css" href="../css/loading.css" />
    <link href="../Script/slick/slick.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="https://res.wx.qq.com/open/libs/weui/1.1.2/weui.min.css" />
    <script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <link rel="stylesheet" href="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/css/bootstrap.min.css" />
    <script src="../Script/iconfont.js"></script>
    <link href="../Script/iconfont.css" rel="stylesheet" />
    <link href="../Script/slick/iconfont.css" rel="stylesheet" />
    <script src="../Script/slick/iconfont.js"></script>

    <script src="http://cdn.static.runoob.com/libs/bootstrap/3.3.7/js/bootstrap.min.js"></script>
    <script type="text/javascript">
        $(window).load(function () {
            $(".loading").addClass("loader-chanage")
            $(".loading").fadeOut(300)
        })
        var openid = "";
        var typename = "";
        var ismenu = "";
        var returntime = "";
        var deductions = "";
        var type = "";
        var dayprice = "";
        $(function () {
            function getUrlParam(openid) {
                var reg = new RegExp("(^|&)" + openid + "=([^&]*)(&|$)");
                var r = window.location.search.substr(1).match(reg);
                if (r != null) return unescape(r[2]); return null;
            }
            openid = getUrlParam('openid');
            type = getUrlParam('type');
            SelectState('all');
            $.ajax({
                type: "post",
                url: "../MenuReserveHandler.ashx",
                dataType: "json",
                async: false,
                data: { funcName: 'getall' },
                success: function (data) {
                    for (var i = 0; i < data.length; i++) {
                        typename = data[i].typename;
                        ismenu = data[i].ismenu;
                        returntime = data[i].returntime;
                        deductions = data[i].deductions;
                        dayprice = data[i].dayprice;
                    }
                },
                error: function () {
                    alert("异常！");
                }
            });
        });
        //退餐，余额支付，不扣款，直接修改状态为4，退订状态。微信支付，调用微信退款接口

        function shan(OrderId, TotalPrice) {

            $.ajax({
                type: "post",
                url: "../MenuReserveHandler.ashx",
                dataType: "json",
                async: false,
                data: { OrderId: OrderId, funcName: 'getpayType' },
                success: function (data) {
                    for (var i = 0; i < data.length; i++) {

                        var payType = data[i].payType;
                        if (payType == "微信支付") {
                            //  debugger
                            //$.ajax({
                            //    type: "post",
                            //    url: "../MenuReserveHandler.ashx",
                            //    dataType: "json",
                            //    async: false,
                            //    data: { OrderId: OrderId, TotalPrice: TotalPrice, funcName: 'WxRefund' },
                            //    success: function () {

                            //    },
                            //    error: function () {
                            //        alert("异常！");
                            //    }
                            //});
                            $("#qu").remove();
                            $("#dialog1 .weui-dialog__bd").html("微信支付，不能退餐！");
                            $("#dialog1").css("display", "block");

                        }
                        else {
                            $.ajax({
                                type: "post",
                                url: "../MenuReserveHandler.ashx",
                                dataType: "json",
                                async: false,
                                // data: { OrderId: OrderId, funcName: 'Refund' },
                                data: { OrderId: OrderId, TotalPrice: TotalPrice, openid: openid, funcName: 'Refund' },
                                success: function () {
                                    $("#toast").css("display", "block");
                                    $("#toast").fadeOut(2000);
                                    $("#" + OrderId + "").parents(".panel").remove();

                                    //刷新当前页面
                                    // window.location.reload();
                                },
                                error: function () {
                                    alert("异常！");
                                }
                            });
                        }
                    }
                },
                error: function () {
                    alert("异常！");
                }
            });

        }

        //点击查询订单详情
        function ReDetailed(OrderId) {
            console.log("点击进入到订单详情跳转：" + OrderId);
            location.href = 'Order_details.aspx?orderid=' + OrderId + '';
        }


        //退餐操作，判断时间是否可退，弹框提示
        function Refund(OrderId, reservationdate, menuName, TimeState, TotalPrice) {
            var kssj = "";
            $.ajax({
                type: "post",
                url: "../MenuReserveHandler.ashx",
                dataType: "json",
                async: false,
                data: { sdmc: TimeState, canteen: menuName, openid: openid, funcName: 'getTimeState' },//查看订餐时段（早中晚夜）
                success: function (data) {
                    for (var i = 0; i < data.length; i++) {
                        //kssj = data[i].kssj;
                        if (TimeState.trim() == "早餐") {
                            kssj = data[i].sd1;
                        } if (TimeState.trim() == "午餐") {
                            kssj = data[i].sd3;
                        } if (TimeState.trim() == "晚餐") {
                            kssj = data[i].sd5;
                        } if (TimeState.trim() == "超市") {
                            kssj = data[i].sd2;
                        }

                    }
                },
                error: function () {
                    alert("异常01！");
                }
            });

            $.ajax({
                type: "post",
                url: "../MenuReserveHandler.ashx",
                dataType: "json",
                async: false,
                data: { funcName: 'getall' },//查看订餐类型（按餐，）
                success: function (data) {
                    //   debugger

                    for (var i = 0; i < data.length; i++) {
                        var returntime = data[i].returntime;


                        var d = new Date();
                        c = d.setMinutes(d.getMinutes() + returntime);
                        c = new Date(c);
                        var b = reservationdate + " " + kssj;
                        b = new Date(b.replace(/-/g, "/"));

                        if (c < b) {
                            //var d = new Date();
                            //var a = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate() + " " + (d.getHours()) + ":" + (d.getMinutes() + returntime) + ":" + d.getSeconds();
                            //var cc = reservationdate + " " + kssj;
                            ////if (new Date(a) < new Date(reservationdate + " " + kssj)) {
                            // if (new Date(Date.parse(a.replace(/-/g,"/"))) < new Date(Date.parse(cc.replace(/-/g,"/")))) {//兼容ios系统日期格式
                            //debugger
                            $("#qu").remove();
                            $(".weui-dialog__bd").html("是否退餐");
                            $(".weui-dialog__ft").prepend('<a href="" class="weui-dialog__btn weui-dialog__btn_default" id="qu" style="text-decoration:none;">取消</a>');
                            $("#qu").attr('href', "javascript:$('#dialog').hide();")
                            $("#dialog").css("display", "block");
                            $("#qu").remove();
                            $('#que').attr("onclick", "shan(\'" + OrderId + "\'," + TotalPrice + ")");
                        }
                        else {
                            $('#que').removeAttr("onclick");
                            $(".weui-dialog__bd").html("已超过超市退款时间,不可退订,如有疑问,请联系管理员!");
                            $("#dialog").css("display", "block");
                            return;
                        }
                    }
                },
                error: function () {
                    //alert("异常！");
                }
            });
        }



        //更改订单状态，是否送达
        function Changestate(OrderId) {


            $.ajax({
                type: "post",
                url: "../MenuReserveHandler.ashx",
                dataType: "json",
                async: false,
                data: { OrderId: OrderId, funcName: 'getCState' },
                success: function (data) {

                    alert("该订单已送达");
                    $(".weui-dialog__bd").html("该订单已送达!");

                    window.location.reload();
                },
                error: function () {
                    alert("异常！");
                }

            });






        }


        //显示订单列表
        function SelectState(state) {

            $("#Topayment,#Totakefood, #Havetakefood,#Toevaluate,#all").removeClass("cur");
            $("#" + state).addClass("cur");
            document.getElementById('accordion').innerText = "";
            openid = openid == null ? '<%=openid%>' : openid;
            type = type == null ? "list0" : type;
            $.ajax({
                type: "post",
                url: "../MenuReserveHandler.ashx",
                data: { State: state, openid: openid, type: type, funcName: 'getOrderList' },
                success: function (data) {
                    $("#empty").remove();
                    if (data == null || data == "[]") {
                        $("#accordion").after('<div style="text-align:center;padding-top:3rem;" id="empty"><img src="../images/order.png" style="width:2rem;" /><p style="padding-top:.3rem">没有相关订单</p></div>');
                    }
                    item = $.parseJSON(data);

                    for (var i = 0; i < item.length; i++) {
                        var OrderId = item[i].OrderId;
                        var State = item[i].State;
                        var Ryid = item[i].Ryid;
                        var address = item[i].address5;//获取地址
                        var telnum = item[i].telnum;//获取电话
                        var ryxm = item[i].ryxm;//获取姓名
                        if (type == "list0") {
                            var TimeStateId = item[i].TimeStateId;
                            var menuName = "";
                            var price = item[i].foodPrice;
                        }
                        if (type == "list1") {
                            var menuName = item[i].cbname;
                            var price = item[i].cbprice;
                        }
                        if (type == "list2") {

                            var price = dayprice;
                        }
                        var OrderNum = item[i].OrderNum;
                        var str = item[i].reservationdate;
                        var TotalPrice = item[i].TotalPrice;
                        var canteen_name = "包月订餐";
                        var tmp = /\d+(?=\+)/.exec(str);
                        var d = new Date(+tmp);
                        var reservationdate = d.getFullYear() + '-' + (+d.getMonth() + 1) + '-' + d.getDate();
                        var TimeState = item[i].foodName;
                        var myar = new Array();
                        $($(".time")).each(function () {
                            myar.push($(this).text());
                        });


                            if (myar.indexOf(OrderId) != -1) {//已包含该订单号
                                if (State == "2") {//待取餐
                                    if (type == "list0") {//按餐就餐或按天就餐，按菜品
                                        $("#" + OrderId + " .panel-body").prepend(' <div class="order-list clearfloat" id="list"><div class="list clearfloat fl box-s" name="list"><a href="#" style="text-decoration:none;color:black"><div class="middle clearfloat fl"><p class="tit">就餐时间：' + reservationdate + ' </p><p class="price clearfloat" style="color:black">' + TimeState + '&nbsp;&nbsp;' + menuName + '&nbsp;<span >￥' + price + '</span><span class="shu" style="margin-right:-20%;">×' + OrderNum + '</span></p></div></a></div></div>');
                                    } else if (type == "list1")//按餐就餐，不按菜品
                                    {
                                        $("#" + OrderId + " .panel-body").prepend(' <div class="order-list clearfloat" id="list"><div class="list clearfloat fl box-s" name="list"><a href="#" style="text-decoration:none;color:black"><div class="middle clearfloat fl"><p class="tit">就餐时间：' + reservationdate + ' </p><p class="price clearfloat" style="color:black">' + menuName + '&nbsp;<span >￥' + price + '</span><span class="shu" style="margin-right:-20%;">×' + OrderNum + '</span></p></div></a></div></div>');
                                    }
                                    else if (type == "list2")//按天就餐，不按菜品
                                    {
                                        $("#" + OrderId + " .panel-body").prepend(' <div class="order-list clearfloat" id="list"><div class="list clearfloat fl box-s" name="list"><a href="#" style="text-decoration:none;color:black"><div class="middle clearfloat fl"><p class="tit">就餐时间：' + reservationdate + ' </p><p class="price clearfloat" style="color:black"><span >￥' + price + '</span><span class="shu" style="margin-right:-20%;">×' + OrderNum + '</span></p></div></a></div></div>');
                                    }
                                } else {
                                    if (type == "list0") {
                                        $("#" + OrderId + " .panel-body").prepend(' <div class="order-list clearfloat" id="list"><div class="list clearfloat fl box-s" name="list"><a href="#" style="text-decoration:none;color:black"><div class="middle clearfloat fl"><p class="tit">就餐时间：' + reservationdate + ' </p><p class="price clearfloat" style="color:black">' + TimeState + '&nbsp;&nbsp;' + menuName + '&nbsp;<span >￥' + price + '</span><span class="shu" style="margin-right:-20%;">×' + OrderNum + '</span></p></div></a></div></div>');
                                    }
                                    else if (type == "list1") {
                                        $("#" + OrderId + " .panel-body").prepend(' <div class="order-list clearfloat" id="list"><div class="list clearfloat fl box-s" name="list"><a href="#" style="text-decoration:none;color:black"><div class="middle clearfloat fl"><p class="tit">就餐时间：' + reservationdate + ' </p><p class="price clearfloat" style="color:black">' + menuName + '&nbsp;<span >￥' + price + '</span><span class="shu" style="margin-right:-20%;">×' + OrderNum + '</span></p></div></a></div></div>');

                                    }
                                    else if (type == "list2") {
                                        $("#" + OrderId + " .panel-body").prepend(' <div class="order-list clearfloat" id="list"><div class="list clearfloat fl box-s" name="list"><a href="#" style="text-decoration:none;color:black"><div class="middle clearfloat fl"><p class="tit">就餐时间：' + reservationdate + ' </p><p class="price clearfloat" style="color:black"><span >￥' + price + '</span><span class="shu" style="margin-right:-20%;">×' + OrderNum + '</span></p></div></a></div></div>');

                                    }
                                }
                            }
                            else {//不包含该订单号
                                if (State == "1")//未付款
                                {
                                    $("#accordion").prepend(' <div class="panel panel-default"><div class="panel-heading"><a data-toggle="collapse" data-parent="#accordion" name="date" href="#' + OrderId + '"><h4 class="panel-title">订单号：<span class="time">' + OrderId + '</span>   &nbsp&nbsp&nbsp&nbsp     <span class="time">' + canteen_name + '</span>                                <span class="orderstste" style="text-decoration:none;">待付款 </span></h4> </a></div><div id="' + OrderId + '" class="panel-collapse collapse"><div class="panel-body" style="padding:3%;"></div></div></div>');
                                    if (type == "list0") {
                                        $("#" + OrderId + " .panel-body").prepend(' <div class="order-list clearfloat" id="list"><div class="list clearfloat fl box-s" name="list"><a href="#" style="text-decoration:none;color:black"><div class="middle clearfloat fl"><p class="tit">就餐时间：' + reservationdate + ' </p><p class="price clearfloat" style="color:black">' + TimeState + '&nbsp;&nbsp;' + menuName + '&nbsp;<span >￥' + price + '</span><span class="shu" style="margin-right:-20%;">×' + OrderNum + '</span></p></div></a></div><span>合计 ￥' + TotalPrice + '</span>  订单号：<span class="time">' + OrderId + '</span>   <a href="../JsSDK/WxPay/SubmitOrder.aspx?price=' + TotalPrice + '&OrderID=' + OrderId + '&openid=' + openid + '&seldate_dummy=' + reservationdate + '" class="gopay-btn fr" style="text-decoration:none;">立即支付</a ></div>');
                                    }
                                    else if (type == "list1") {
                                        $("#" + OrderId + " .panel-body").prepend(' <div class="order-list clearfloat" id="list"><div class="list clearfloat fl box-s" name="list"><a href="#" style="text-decoration:none;color:black"><div class="middle clearfloat fl"><p class="tit">就餐时间：' + reservationdate + ' </p><p class="price clearfloat" style="color:black">' + menuName + '&nbsp;<span >￥' + price + '</span><span class="shu" style="margin-right:-20%;">×' + OrderNum + '</span></p></div></a></div><span>合计 ￥' + TotalPrice + '</span>   订单号：<span class="time">' + OrderId + '</span>  <a href="../JsSDK/WxPay/SubmitOrder.aspx?price=' + TotalPrice + '&OrderID=' + OrderId + '&openid=' + openid + '&seldate_dummy=' + reservationdate + '" class="gopay-btn fr" style="text-decoration:none;">立即支付</a ></div>');
                                    }
                                    else if (type == "list2") {
                                        $("#" + OrderId + " .panel-body").prepend(' <div class="order-list clearfloat" id="list"><div class="list clearfloat fl box-s" name="list"><a href="#" style="text-decoration:none;color:black"><div class="middle clearfloat fl"><p class="tit">就餐时间：' + reservationdate + ' </p><p class="price clearfloat" style="color:black"><span >￥' + price + '</span><span class="shu" style="margin-right:-20%;">×' + OrderNum + '</span></p></div></a></div><span>合计 ￥' + TotalPrice + '</span> 订单号：<span class="time">' + OrderId + '</span>    <a href="../JsSDK/WxPay/SubmitOrder.aspx?price=' + TotalPrice + '&OrderID=' + OrderId + '&openid=' + openid + '&seldate_dummy=' + reservationdate + '" class="gopay-btn fr" style="text-decoration:none;">立即支付</a ></div>');
                                    }
                                }



                                    if (State == "2") {    //待配送                                                                                                                                             
                                        $("#accordion").prepend(' <div class="panel panel-default"><div class="panel-heading"><a data-toggle="collapse" data-parent="#accordion" name="date" href="#' + OrderId + '"><h4 class="panel-title">订单号：<span class="time">' + OrderId + '</span>    &nbsp&nbsp&nbsp&nbsp   <span class="time">' + canteen_name + '</span>       <span class="orderstste" style="text-decoration:none;">未完成 </span></h4></a></div><div id="' + OrderId + '" class="panel-collapse collapse"><div class="panel-body" style="padding:3%;"></div></div></div>');
                                        if (type == "list0") {
                                            // $("#" + OrderId + " .panel-body").prepend(' <div class="order-list clearfloat" id="list"><div class="list clearfloat fl box-s" name="list"><a href="#" style="text-decoration:none;color:black"><div class="middle clearfloat fl"><p class="tit">就餐时间：' + reservationdate + ' </p><p class="price clearfloat" style="color:black">' + TimeState + '&nbsp;&nbsp;' + menuName + '&nbsp;<span >￥' + price + '</span><span class="shu" style="margin-right:-20%;">×' + OrderNum + '</span></p></div></a></div><span>合计 ￥' + TotalPrice + '</span><a href="#" class="gopay-btn fr" style="text-decoration:none;" onclick="Changestate(\'' + OrderId + '\',\'' + reservationdate + '\',\'' + menuName + '\',\'' + TimeState + '\',' + TotalPrice + ')">点此已送达</a >                <a href="#" class="gopay-btn fr" style="text-decoration:none;" onclick="Refund(\'' + OrderId + '\',\'' + reservationdate + '\',\'' + menuName + '\',\'' + TimeState + '\',' + TotalPrice + ')">退餐</a ></div>');

                                            $("#" + OrderId + " .panel-body").prepend(' <div class="order-list clearfloat" id="list"><div class="list clearfloat fl box-s" name="list"><a href="#" style="text-decoration:none;color:black"><div class="middle clearfloat fl"><p class="tit">就餐时间：' + reservationdate + ' </p><p class="price clearfloat" style="color:black">' + TimeState + '&nbsp;&nbsp;' + menuName + '&nbsp;<span >￥' + price + '</span><span class="shu" style="margin-right:-20%;">×' + OrderNum + '</span></p></div></a></div><span>合计 ￥' + TotalPrice + '</span><a href="#" class="gopay-btn fr" style="text-decoration:none;" onclick="Changestate(\'' + OrderId + '\',\'' + reservationdate + '\',\'' + menuName + '\',\'' + TimeState + '\',' + TotalPrice + ')">点此已送达</a >    <a href="#" class="gopay-btn fr" style="text-decoration:none;display:none;" onclick="ReDetailed(\'' + OrderId + '\')">订单详情</a >  <a href="#" class="gopay-btn fr" style="text-decoration:none;display:none;"onclick="Refund(\'' + OrderId + '\',\'' + reservationdate + '\',\'' + canteen_name + '\',\'' + TimeState + '\',' + TotalPrice + ')">退餐</a >      </div>');
                                        }

                                    }
                                    else {


                                        if (State == "2") {    //待取餐                                                                                                                                             
                                            $("#accordion").prepend(' <div class="panel panel-default"><div class="panel-heading"><a data-toggle="collapse" data-parent="#accordion" name="date" href="#' + OrderId + '"><h4 class="panel-title">订单号：<span class="time">' + OrderId + '</span>   &nbsp&nbsp&nbsp&nbsp   <span class="tit">' + canteen_name + '</span>          <span class="orderstste" style="text-decoration:none;">未完成 </span></h4></a></div><div id="' + OrderId + '" class="panel-collapse collapse"><div class="panel-body" style="padding:3%;"></div></div></div>');
                                            if (type == "list0") {
                                                $("#" + OrderId + " .panel-body").prepend(' <div class="order-list clearfloat" id="list"><div class="list clearfloat fl box-s" name="list"><a href="#" style="text-decoration:none;color:black"><div class="middle clearfloat fl"><p class="tit">就餐时间：' + reservationdate + ' </p><p class="price clearfloat" style="color:black">' + TimeState + '&nbsp;&nbsp;' + menuName + '&nbsp;<span >￥' + price + '</span><span class="shu" style="margin-right:-20%;">×' + OrderNum + '</span></p></div></a></div><span>合计 ￥' + TotalPrice + '</span>  <a href="#" class="gopay-btn fr" style="text-decoration:none;display:none;" onclick="ReDetailed(\'' + OrderId + '\')">订单详情</a >  <a href="#" class="gopay-btn fr" style="text-decoration:none;display:none;"onclick="Refund(\'' + OrderId + '\',\'' + reservationdate + '\',\'' + canteen_name + '\',\'' + TimeState + '\',' + TotalPrice + ')">退餐</a >  </div>');
                                            }

                                        }


                                    }

                                



                                if (State == "3") {         //已取餐                                                                                                                                       
                                    $("#accordion").prepend(' <div class="panel panel-default"><div class="panel-heading"><a data-toggle="collapse" data-parent="#accordion" name="date" href="#' + OrderId + '"><h4 class="panel-title">订单号：<span class="time">' + OrderId + '</span>      &nbsp&nbsp&nbsp&nbsp   <span class="tit">' + canteen_name + '</span>        <span class="orderstste" style="text-decoration:none;">已完成 </span></h4></a></div><div id="' + OrderId + '" class="panel-collapse collapse"><div class="panel-body" style="padding:3%;"></div></div></div>');
                                    if (type == "list0") {
                                        $("#" + OrderId + " .panel-body").prepend(' <div class="order-list clearfloat" id="list"><div class="list clearfloat fl box-s" name="list"><a href="#" style="text-decoration:none;color:black"><div class="middle clearfloat fl"><p class="tit">就餐时间：' + reservationdate + ' </p><p class="price clearfloat" style="color:black">' + TimeState + '&nbsp;&nbsp;' + menuName + '&nbsp;<span >￥' + price + '</span><span class="shu" style="margin-right:-20%;">×' + OrderNum + '</span></p></div></a></div><span>合计 ￥' + TotalPrice + '</span>  </div>  ');
                                    }

                                }

                                //OrderId.slice(0, 8),只显示前8位

                                //if (State == "4") {         //已退餐                                                                                                                                       
                                //    $("#accordion").prepend(' <div class="panel panel-default"><div class="panel-heading"><a data-toggle="collapse" data-parent="#accordion" name="date" href="#' + OrderId + '"><h4 class="panel-title">订单号：<span class="time">' + OrderId + '</span>      &nbsp&nbsp&nbsp&nbsp   <span class="tit">' + TimeState + '</span>        <span class="orderstste" style="text-decoration:none;">已退餐 </span></h4></a></div><div id="' + OrderId + '" class="panel-collapse collapse"><div class="panel-body" style="padding:3%;"></div></div></div>');
                                //    if (type == "list0") {
                                //        $("#" + OrderId + " .panel-body").prepend(' <div class="order-list clearfloat" id="list"><div class="list clearfloat fl box-s" name="list"><a href="#" style="text-decoration:none;color:black"><div class="middle clearfloat fl"><p class="tit">就餐时间：' + reservationdate + ' </p><p class="price clearfloat" style="color:black">' + TimeState + '&nbsp;&nbsp;' + menuName + '&nbsp;<span >￥' + price + '</span><span class="shu" style="margin-right:-20%;">×' + OrderNum + '</span></p></div></a></div><span>合计 ￥' + TotalPrice + '</span>  电话：  <span class="telnum" >' + telnum + ' </span>   订单号：<span class="time">' + OrderId + '</span>  </div> <div> <a href="#" class="gopay-btn fr" style="text-decoration:none;" onclick="ReDetailed(\'' + OrderId + '\')">订单详情</a > </div> ');
                                //    } else if (type == "list1") {
                                //        $("#" + OrderId + " .panel-body").prepend(' <div class="order-list clearfloat" id="list"><div class="list clearfloat fl box-s" name="list"><a href="#" style="text-decoration:none;color:black"><div class="middle clearfloat fl"><p class="tit">就餐时间：' + reservationdate + ' </p><p class="price clearfloat" style="color:black">' + TimeState + '&nbsp;&nbsp;' + menuName + '&nbsp;<span >￥' + price + '</span><span class="shu" style="margin-right:-20%;">×' + OrderNum + '</span></p></div></a></div><span>合计 ￥' + TotalPrice + '</span>  电话：  <span class="telnum" >' + telnum + ' </span>   订单号：<span class="time">' + OrderId + '</span>  </div> <div> <a href="#" class="gopay-btn fr" style="text-decoration:none;" onclick="ReDetailed(\'' + OrderId + '\')">订单详情</a > </div> ');
                                //    }
                                //    else if (type == "list2") {
                                //        $("#" + OrderId + " .panel-body").prepend(' <div class="order-list clearfloat" id="list"><div class="list clearfloat fl box-s" name="list"><a href="#" style="text-decoration:none;color:black"><div class="middle clearfloat fl"><p class="tit">就餐时间：' + reservationdate + ' </p><p class="price clearfloat" style="color:black">' + TimeState + '&nbsp;&nbsp;' + menuName + '&nbsp;<span >￥' + price + '</span><span class="shu" style="margin-right:-20%;">×' + OrderNum + '</span></p></div></a></div><span>合计 ￥' + TotalPrice + '</span>  电话：  <span class="telnum" >' + telnum + ' </span>   订单号：<span class="time">' + OrderId + '</span>  </div> <div> <a href="#" class="gopay-btn fr" style="text-decoration:none;" onclick="ReDetailed(\'' + OrderId + '\')">订单详情</a > </div> ');

                                //    }

                                //}


                            }
                        

                    }

                },
                error: function () {
                    alert("异常！");
                }
            });
        }

    </script>
</head>



<!--loading页开始-->
<div class="loading">
    <div class="loader">
        <div class="loader-inner pacman">
            <div></div>
            <div></div>
            <div></div>
            <div></div>
            <div></div>
        </div>
    </div>
</div>
<!--loading页结束-->



<body>

<%--    <header class="mui-bar mui-bar-nav report-header box-s" id="header">
        <a href="javascript:history.go(-1)"><i class="iconfont icon-fanhui fl"></i></a>
        <p>订单列表</p>
    </header>--%>
    <div id="main" class="sjfenlei mui-clearfix">

        <div class="order-top2 clearfloat" style="position: fixed; z-index: 10;">
            <ul>
                <li class="clearfloat" onclick="SelectState('all')" id="all" style="width: 25%"><a href="#" style="text-decoration: none">全部</a></li>
                <li class="clearfloat" onclick="SelectState('Totakefood')" id="Totakefood" style="width: 25%"><a href="#" style="text-decoration: none">未完成</a></li>
                <li class="clearfloat" onclick="SelectState('Topayment')" id="Topayment" style="width: 25%"><a href="#" style="text-decoration: none">待付款</a></li>
                <%--<li class="clearfloat" onclick="SelectState('Totakefood')" id="Totakefood"  style="width:20%"><a href="#" style="text-decoration:none">待取餐</a></li>--%>
                <li class="clearfloat" onclick="SelectState('Havetakefood')" id="Havetakefood" style="width: 25%"><a href="#" style="text-decoration: none">已完成</a></li>

            </ul>
        </div>

        <div class="panel-group" id="accordion" style="padding-top: 2rem">
        </div>

        <div style="display: none;" id="dialog1">
            <div class="weui-mask"></div>
            <div class="weui-dialog">
                <div class="weui-dialog__hd"><strong class="weui-dialog__title">提示</strong></div>
                <div class="weui-dialog__bd"></div>
                <div class="weui-dialog__ft">
                    <a href="javascript:$('#dialog1').hide();" class="weui-dialog__btn weui-dialog__btn_primary" style="text-decoration: none;">确定</a>
                </div>
            </div>
        </div>
        <div style="display: none;" id="dialog">
            <div class="weui-mask"></div>
            <div class="weui-dialog">
                <div class="weui-dialog__hd"><strong class="weui-dialog__title">提示</strong></div>
                <div class="weui-dialog__bd"></div>
                <div class="weui-dialog__ft">
                    <a href="javascript:$('#dialog').hide();" class="weui-dialog__btn weui-dialog__btn_primary" id="que" style="text-decoration: none;">确定</a>
                </div>
            </div>
        </div>
        <div id="toast" style="display: none;">
            <div class="weui-mask_transparent"></div>
            <div class="weui-toast">
                <i class="weui-icon-success-no-circle weui-icon_toast"></i>
                <p class="weui-toast__content">退餐成功！</p>
            </div>
        </div>
        <style type="text/css">
            .more-btn {
                width: 25%;
                padding: 3% 0;
                text-align: center;
                background-color: #00CC7D;
                color: #fff;
                font-size: .5rem;
                margin: 5% auto;
            }

            .orderstste {
                font-size: .35rem;
                margin-left: 11%;
                padding: 0rem; /*订单标题背景块大小*/
                background-color: #417dbf;
                color: #fff;
            }
        </style>

    </div>
    <!--footer star-->
    <footer class="page-footer fixed-footer" id="footer">
        <ul>


            <%--	<li class="right">
					<a href="ReserveMenu.aspx" style="text-decoration:none;">
						<i class="iconfont icon-icon04"></i>
						<p>在线订餐</p>
					</a>
				</li>
				<li class="active">
					<a href="#" style="text-decoration:none;">
						<i class="iconfont icon-gouwuche"></i>
						<p>我的订餐</p>
					</a>
				</li>--%>


            <li class="right">
                <a href="ReserveMenu.aspx" style="text-decoration: none;">
                    <i class="iconfont icon-swticondingcan"></i>
                    <p>在线订餐</p>
                </a>
            </li>


            <li class="center">

                <a href="#" style="text-decoration: none;">

                    <%--<span name="count" style="border: solid 1px red;width:20px;height:20px;border-radius:10px;text-align:center;color: white;font-size: 12px;line-height: 15px;position: absolute;background-color: red;left: 50%;">0</span>--%>
                    <i class="iconfont icon-gouwuche"></i>


                    <p>购物车</p>
                </a>
            </li>


            <li class="active">
                <a href="#" style="text-decoration: none;">
                    <i class="iconfont icon-dingdan"></i>
                    <p>我的订单</p>
                </a>
            </li>





        </ul>
    </footer>
    <!--footer end-->
</body>
<script type="text/javascript" src="../Script/jquery-1.8.3.min.js"></script>
<script src="../Script/fastclick.js"></script>
<script src="../Script/mui.min.js"></script>
<script type="text/javascript" src="../Script/hmt.js"></script>

</html>
